Skip to content

fix: remove PR_SET_PDEATHSIG that kills Chrome after ~10s idle (#1157)#1173

Merged
ctate merged 1 commit intomainfrom
ctate/fix-1157
Apr 6, 2026
Merged

fix: remove PR_SET_PDEATHSIG that kills Chrome after ~10s idle (#1157)#1173
ctate merged 1 commit intomainfrom
ctate/fix-1157

Conversation

@ctate
Copy link
Copy Markdown
Collaborator

@ctate ctate commented Apr 6, 2026

v0.24.1 introduced prctl(PR_SET_PDEATHSIG, SIGKILL) in #1137 to kill Chrome when the daemon dies. However, PR_SET_PDEATHSIG tracks the thread that called fork(), not the process (prctl(2) documents this). Chrome is spawned via tokio::task::spawn_blocking, whose threads are reaped after ~10 seconds of idle time. When the blocking thread exits, the kernel sends SIGKILL to Chrome even though the daemon is still alive.

Symptoms reported in #1157:

  • tab list shows about:blank after a few seconds
  • snapshot returns an empty page
  • All Chrome processes exit ~9 seconds after launch
  • Any workflow involving navigation or waiting breaks

The fix removes PR_SET_PDEATHSIG from the Chrome pre_exec hook. Orphan cleanup is already handled by the process-group kill (kill(-pgid, SIGKILL)) in ChromeProcess::kill(), which runs via daemon signal handlers, close_notify, idle timeout, and Drop.

Fixes #1157

v0.24.1 introduced `prctl(PR_SET_PDEATHSIG, SIGKILL)` in #1137 to kill Chrome
when the daemon dies. However, `PR_SET_PDEATHSIG` tracks the **thread** that
called `fork()`, not the process (`prctl(2)` documents this). Chrome is spawned
via `tokio::task::spawn_blocking`, whose threads are reaped after ~10 seconds of
idle time. When the blocking thread exits, the kernel sends SIGKILL to Chrome
even though the daemon is still alive.

Symptoms reported in #1157:
- `tab list` shows `about:blank` after a few seconds
- `snapshot` returns an empty page
- All Chrome processes exit ~9 seconds after launch
- Any workflow involving navigation or waiting breaks

The fix removes `PR_SET_PDEATHSIG` from the Chrome `pre_exec` hook. Orphan
cleanup is already handled by the process-group kill (`kill(-pgid, SIGKILL)`) in
`ChromeProcess::kill()`, which runs via daemon signal handlers, `close_notify`,
idle timeout, and `Drop`.

Fixes #1157
@vercel
Copy link
Copy Markdown
Contributor

vercel bot commented Apr 6, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
agent-browser Ready Ready Preview, Comment Apr 6, 2026 10:52pm
agent-browser-env-demo Ready Ready Preview, Comment Apr 6, 2026 10:52pm

@ctate ctate merged commit eb15cc0 into main Apr 6, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CDP target lost after form submission / SPA navigation — tab becomes about:blank

1 participant